package utils;

import android.app.Activity;

import java.io.IOException;

/**
 * Created by ZQ on 2016/4/23.
 */
public class Globals {
    public static int SCREEN_WIDTH;
    public static int SCREEN_HEIGHT;
    public static int GRID_SIZE;
    public static int GRID_SEP = 5;
    public static MySqlDB sdb;

    public static final int TEXT_ALIGN_CENTER_VERTICAL   = 0x00000100;
    public static final int TEXT_ALIGN_CENTER_HORIZONTAL = 0x00001000;
    public static void init(Activity a){
        sdb = new MySqlDB(a);
        SCREEN_WIDTH = a.getWindowManager().getDefaultDisplay().getWidth();
        SCREEN_HEIGHT = a.getWindowManager().getDefaultDisplay().getHeight();
        GRID_SIZE = SCREEN_WIDTH/8;
        try {
            Images.init(a);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
